The Jementah Civil War happened in 1879 in Jementah, Sultanate of Johor when Tengku Alam Shah, the heir of Sultan Ali of Muar refused to give the district of Muar to the temporary administration of Sultan Abu Bakar of Johor (then Maharaja in 1879). The final result of the civil war became a factor of the opening of the town of Muar.
Before Sultan Abu Bakar became the ruler of Johor, Johor was ruled by Temenggong Ibrahim who was more favored than Sultan Ali. To settle the problems of administration, Sultan Ali was given the district of Muar while Temenggong Ibrahim ruled the remaining districts in Johor.
The war was triggered on 25 October 1879 because Sultan Ali crowned his 11-year-old son named Tengku Mahmood as his successor after his death, resulting in Tengku Alam's fury and envy. He also felt unsatisfied when Colonel Archibald Anson put the district of Muar under Maharaja Abu Bakar's temporary administration.
He began his moves by asking his cousins Tengku Nong and Tengku Mat to spread false information to the residents of Muar district to be on his side. He also gathered some powerful warriors for the battle.
Tengku Alam and his followers launched the first blow of the war by attacking Jementah on 25 October 1879 and winning the battle. As a result, the headman of Jementah sent reports to the ruler of Johor and Maharaja Abu Bakar responded by sending a powerful army of soldiers led by his cousin, Ungku Ahmad. Ungku Ahmad was a great tactician who contributed to Johor's rapid victory.
Dato' Mohammed Salleh bin Perang, also known as Dato' Bentara Luar, was sent to the battlefield by the government on 2 December 1879 to assist the government army. As a strategy, he split the Johor government army into four parts to fight enemies easier. Each component contained about 100 soldiers.
During the middle of December 1879, the government army conquered more enemy strongholds and finally gained total victory at dawn on 30 December 1879 after a surprise attack on the enemy's final redoubt. Since then, the original District of Muar which included Segamat was re-occupied by the government of Johor.
The most notable event that happened as a result of the Johor government's victory in the Jementah Civil War was the opening of the town of Muar by Maharaja Abu Bakar. Besides this event, the soldiers from both sides who later resided in the areas of Jementah and Segamat opened the residencies (mukim) of Pagoh, as well as some villages there.